<!DOCTYPE html>
  <html>
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
      <title>title</title>
      <link rel="stylesheet" type="text/css" href="../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../css/app.736542db.css"/>
      <style>
          body{
background-color: #ededed
          }  header{ background-color: #ededed; width: 100%;height: 50px;}
            header ul li {background-color: #ededed; height: 50px; line-height: 50px; text-align: left; display: none; color: #323237; position: relative;font-size: 18px;text-indent: 10px;}
            header ul li.active{ display: block; }
            .fl{float: left;}
            .gzhimg{ padding-right: 15px;}
            .jt img{height: 18px; margin-top: 15px;margin-left: 15px;}
           .fr{float: right;}
              .sz  { padding-left: 10px; padding-right: 20px;color: #5b6a91; margin-top: 0px!important;}
              #footer{height: 56px;background-color: #f4f4f4; border-top: 0.8px solid #e5e5e5; text-align: center;line-height: 56px; }
              #footer button{border: none;background-color: #07c160;color: #ffffff;padding: 8px;border-radius:3px; font-size: 12px}


              .flex-con{
                overflow: auto
              }
              .border-b {
                  margin: 0 auto;
                  padding: 0 auto;
                  text-align: center;
                  font-weight: normal;
                  overflow: hidden;
              }
           
.gzhimg{padding-top: 15px; padding-bottom: 15px;}
.sr{ padding-top: 10px; background-color: #f6f6f6}
.input{background: #fff;   height: 38px; border-radius:5px;}
.rightbnt{padding-top: 0px}
.test{
    position: fixed;display: none;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);z-index: 1000;
}

      </style>
  </head>
  <body style="background-color: #ededed">
    <div class="test" id="test">

</div>
    <div id="wrap" class="flex-wrap flex-vertical">
    <header id="header">
      <div class="fl jt"  tapmode onclick="api.closeWin();" ><img src="../image/gzhjt.png" height="40" ></div>
        <ul style="float: left;">

  <li class="border-b active" id="kw" ></li>
        </ul>

        <div class="fr gzhimg" onclick="quinfo()"><img src="../image/gd.png" height="18" ></div>

    </header>
    <div id="main" class="flex-con" style="background-color: #f6f6f6">
        
    </div>



  </div>
  </body>
  <script type="text/javascript" src="../script/api.js"></script>

  <script type="text/javascript">
function quinfo(){

api.openWin({
        name: 'quninfo',
        url: './quninfo.html',
});


}


  function show(){
       $api.css($api.byId('test'),'display:block;');
  }

  function hide(){
       $api.css($api.byId('test'),'display:none;');
         var UIChatBox = api.require('UIChatBox');
       UIChatBox.show();
  }

    function sr(){
      var UIChatBox = api.require('UIChatBox');
   UIChatBox.open({
       placeholder: '',
       maxRows: 4,
       autoFocus:false,
    //   isClose:true,
       emotionPath: 'widget://res/img/emotion',
       texts: {
           recordBtn: {
               normalTitle: '按住说话',
               activeTitle: '松开结束'
           },
           sendBtn: {
               title: '发送'
           }
       },
       styles: {
           inputBar: {
               borderColor: '#d9d9d9',
               bgColor: '#f2f2f2'
           },
           inputBox: {
               borderColor: '#B3B3B3',
                textColor:'#8e8e8e',
               bgColor: '#FFFFFF',
               leftIcon:{                      //(可选项)JSON对象，输入框左侧图标  本参数仅支持android
         size:20,                //(可选项)数字类型；icon的大小；默认：20
         path:''//字符串类型；icon的路径；支持widget:// fs://
     }
           },
           emotionBtn: {
               normalImg: 'widget://image/biaoqing.png'
           },
           extrasBtn: {
               normalImg: 'widget://image/jia.png'
           },
           keyboardBtn: {

           },
           speechBtn: {
               normalImg: 'widget://image/shuo.png'
           },
           recordBtn: {
               normalBg: '#c4c4c4',
               activeBg: '#999999',
               color: '#000',
               size: 14
           },
           indicator: {
               target: 'both',
               color: '#c4c4c4',
               activeColor: '#9e9e9e'
           },
           sendBtn: {
               titleColor: '#fff',
               bg: '#07c160',
               activeBg: '#07a352',
               titleSize: 14
           }
       },
       extras: {
           titleSize: 10,
           titleColor: '#a3a3a3',
           isAdaptScreenSize:false,
           btns: [{
               title: '相册',
               normalImg: 'widget://image/xiangce.png',
               activeImg: 'widget://image/xiangce.png',
           }, {
               title: '拍摄',
               normalImg: 'widget://image/paise.png',
               activeImg: 'widget://image/paise.png',
           }, {
               title: '视频拍摄',
               normalImg: 'widget://image/spps.png',
               activeImg: 'widget://image/spps.png',
           }, {
               title: '位置',
               normalImg: 'widget://image/weizhi.png',
               activeImg: 'widget://image/weizhi.png',
           }, {
               title: '红包',
               normalImg: 'widget://image/hongbao.png',
               activeImg: 'widget://image/hongbao.png',
           }, {
               title: '转账',
               normalImg: 'widget://image/zhuangzhang.png',
               activeImg: 'widget://image/zhuangzhang.png',
           }, {
               title: '语音输入',
               normalImg: 'widget://image/yuyinsr.png',
               activeImg: 'widget://image/yuyinsr.png',
           }, {
               title: '我的收藏',
               normalImg: 'widget://image/wdsc.png',
               activeImg: 'widget://image/wdsc.png',
           }, {
               title: '名片',
               normalImg: 'widget://image/mp2.png',
               activeImg: 'widget://image/mp2.png',
           }, {
               title: '文件',
               normalImg: 'widget://image/wj.png',
               activeImg: 'widget://image/wj.png',
           }]
       }
   }, function(ret, err) {
         console.log(JSON.stringify(ret));
    if(ret.index == 0){
        api.openWin({
        name: 'tupian',
        url: './tupian.html',
});

    }


     if(ret.eventType=='send'){


          var jsfun = 'up_say("'+ret.msg+'");';
          api.execScript({
              frameName: 'chatFrame',
              script: jsfun
          });

     }
     if(ret.eventType=='clickExtras'&&ret.index==3){


   show();
UIChatBox.hide();
var jsfun = 'wzxz();';
   api.execScript({
       frameName: 'chatFrame',
       script: jsfun
   });

      //  api.openWin({
      //      name: 'dt',
      //      url: './dtFrame.html',
       //
      //  });




     }


   });
   //UIChatBox.show();
    }


      apiready = function(){
    $api.fixStatusBar( $api.dom('header') );
    api.ajax({
    url:localStorage.getItem('domain') +"/Home/index/txl",
    method: 'get',

      },function(ret,err){
        var ListLength = ret.user.length;
        cr1=Math.floor(Math.random()*ListLength );
        ret.user[cr1].title;

          $api.html($api.byId('kw'),  '<b>'+ret.user[cr1].title+'交流群（'+cr1+'）</b><i class="">a</i>' );

        console.log(cr1);
        console.log()
    })
      var header = $api.byId('header');


          //适配iOS 7+，Android 4.4+状态栏
          header.style.paddingTop = api.safeArea.top +"px" ;



//   $api.html($api.byId('kw'),  '<b>测试（123）</b>' );
      localStorage.setItem('chatwxm', api.pageParam.wxm);

          api.openFrame({
            name: 'chatFrame',
            url: 'chatFrame.html',
            pageParam: {
                id: api.pageParam.id,
              wxm: api.pageParam.wxm

          },

            rect: {
              x:0,
              y:api.safeArea.top+50,
               w: 'auto',
              h:  api.winHeight- api.safeArea.top- 57-api.safeArea.bottom
            }
          });

sr();

    };


  </script>
  </html>
